using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class SelectLevel : MonoBehaviour
{
    public string sceneName;
    public Text levelName;
    public Image image;

    private void Start()
    {
        if (GameManager.instance.gameData.clearLevelNames.Contains(levelName.text))
        {
            image.color = Color.white;
        }
        else
        {
            image.color = Color.gray;
        }
    }
    public void LoadScene()
    {
        GameManager.instance.nowLevelName = levelName.text;
        GameManager.instance.mainMenuPos = MainMenu.instance.targetPos;
        GameManager.instance.ButtonClick();
        SceneManager.LoadScene(sceneName);
    }
}